//
//  PresentBaseViewController.swift
//  Teacher
//
//  Created by 李峰 on 2021/8/13.
//

import UIKit
// 继承该类 不适用xib 创建的控制器
class PresentBaseViewController: UIViewController {

    var dismissCallBack:(()->())?
    let touView = UIControl()

    override func viewDidLoad() {
        super.viewDidLoad()

        touView.frame = view.bounds
        view.insertSubview(touView, at: 0)
        touView.addTarget(self, action: #selector(cancelDismiss), for: .touchUpInside)
        touView.snp.makeConstraints { make in
            make.edges.equalTo(view.snp.edges)
        }
    }
    
    @objc func cancelDismiss(){
        XPLog(message: "ppppp")
        dismissCallBack?()
        self.dismiss(animated: true, completion: nil)
    }
    
    
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
        self.modalTransitionStyle = .crossDissolve
        self.modalPresentationStyle = .overFullScreen
    }
    
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        self.modalTransitionStyle = .crossDissolve
        self.modalPresentationStyle = .overFullScreen
        fatalError("init(coder:) has not been implemented")
        
    }
    
}
